﻿using DataTransfer.Core.Services;
using DataTransfer.SDK.Models;

namespace DataTransfer.Core.Domains
{
    /// <summary>
    /// 
    /// </summary>
    public class ExcelImporter : IExcelImporter
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string Name
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public string DataWriterTypeName
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public Type DataWriterType
        {
            get
            {
                var typeName = this.DataWriterTypeName;
                if (string.IsNullOrEmpty(typeName))
                {
                    return typeof(DefaultDataWriter);
                }
                Type writerType = Type.GetType(this.DataWriterTypeName, true, true);
                return writerType;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public bool PreImport
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public int MaxImportFileSize
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public IEnumerable<IExcelImportSheet> Sheets
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public IDictionary<string, Type> Modules
        {
            get;
            set;
        }

    }
}
